<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="order" /></title>
</head>
<body>
    <h1><fmt:message key="order" />&nbsp;<fmt:message key="order_status" />：<c:out value="${order.statusName}"/></h1>
    <table>
        <tbody>
   
            <tr>
                <th><fmt:message key="order_shippingFirstName" /></th>
                <td>
                    <c:out value="${order.shippingFirstName}"/>                
				</td>
                <th><fmt:message key="order_inode" /></th>
                <td>
                    <c:url var="inodeUrl" value="/domain/order/show">
                        <c:param name="inode" value="${order.inode}"/>
                    </c:url>
                    <a href="${inodeUrl}"><c:out value="${order.inode}"/></a>           
				</td>
            </tr>
            <tr>
                <th><fmt:message key="order_createDate" /></th>
                <td>
                    <c:out value="${order.createDate}"/>                
				</td>
                <th><fmt:message key="order_user" /></th>
                <td>
					<c:url var="userUrl" value="/domain/user/show">
						<c:param name="user.inode" value="${order.user.inode}" />
					</c:url>
                    <a href="${userUrl}"><c:out value="${order.user.loginName}"/></a>             
				</td>
            </tr>
            <tr>
                <th><fmt:message key="order_shippingStreet" /></th>
                <td colspan="3">
					<c:out value="${order.shippingState}"/>&nbsp;<c:out value="${order.shippingCity}"/>&nbsp;<c:out value="${order.shippingStreet}"/>&nbsp;<c:out value="${order.shippingZip}"/>&nbsp;<c:out value="${order.shippingMobile}"/>/<c:out value="${order.shippingPhone}"/> &nbsp;<c:out value="${order.payerEmail}"/>   
				</td>
            </tr>
            <tr>
                <th><fmt:message key="order_shippingBestTime" /></th>
                <td>
                    <c:out value="${order.shippingBestTime}"/>                
				</td>
                <th><fmt:message key="order_shippingBuilding" /></th>
                <td>
                    <c:out value="${order.shippingBuilding}"/>                
				</td>
            </tr>
            <tr>
                <th><fmt:message key="order_comments" /></th>
                <td colspan="3">
                    <c:out value="${order.comments}"/>                
				</td>
            </tr>
            <tr>
                <th><fmt:message key="order_paymentType" /></th>
                <td>
                    <c:out value="${order.paymentType}"/>                
				</td>
                <th><fmt:message key="order_paymentStatus" /></th>
                <td>
                    <c:out value="${order.paymentStatus}"/>                
				</td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="2">
                    <div class="buttons">
                        <c:url var="updateUrl" value="/domain/order/updateForm">
                            <c:param name="order.inode" value="${order.inode}"/>
                        </c:url>
                        <a href="${updateUrl}"><span><fmt:message key="label.link.update"/></span></a>
                        <c:url var="confirmDeleteUrl" value="/domain/order/confirmDelete">
                            <c:param name="order.inode" value="${order.inode}"/>
                        </c:url>
                        <a id="confirmDeleteUrl" href="${confirmDeleteUrl}"><span><fmt:message key="label.link.delete"/></span></a>
                        <script type="text/javascript">
                            Spring.addDecoration(new Spring.AjaxEventDecoration({
                                elementId: "confirmDeleteUrl",
                                event: "onclick",
                                popup: "true",
                                params: { decorator: "none" }
                            }));
                        </script>
                    </div>
                </td>
            </tr>
        </tfoot>
    </table>
    <h2><fmt:message key="label.related.content"/></h2>
	<table class="listEntities">
		<thead>
			<tr>
				<th scope="col">&nbsp;</th>
				<th scope="col"><fmt:message key="orderItem_title"/></th>
				<th scope="col"><fmt:message key="orderItem_sku"/></th>
				<th scope="col"><fmt:message key="orderItem_price"/></th>
				<th scope="col"><fmt:message key="orderItem_quantity"/></th>
				<th scope="col"><fmt:message key="orderItem_totalPrice"/></th>
				<th scope="col"><fmt:message key="orderItem_shippedDate"/></th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${orderItems}" var="item" varStatus="status">
			<tr>
				<td><img src="<c:out value="${adminHttpUrl}${item.friendlyName}" />" width="80" height="80" /></td>
				<td>
					<c:url var="showUrl" value="/domain/contentlet/show">
						<c:param name="contentlet.inode" value="${item.contentletInode}"/>
					</c:url>
					<a href="${showUrl}"><c:out value="${item.title}" /></a>
				</td>
				<td><c:out value="${item.sku}" /></td>
				<td><c:out value="${item.price}" /></td>
				<td><c:out value="${item.quantity}" /></td>
				<td><c:out value="${item.totalPrice}" /></td>
				<td><c:out value="${item.shippedDate}" /></td>
			</tr>
		</tbody>
		</c:forEach>
	</table>

</body>
